const Editor = require('../../../src/index');
const expect = require('chai').expect;
const Util = Editor.Util;

describe('editor', () => {
  const editor = new Editor();
  const dom = Util.createDOM(`
    <div>
      <div id="page"></div>
    </div>
  `);
  document.body.appendChild(dom);
  const page = new Editor.Flow({
    graph: {
      container: 'page',
      height: 500
    },
    grid: true
  });
  it('add', () => {
    editor.add(page);
  });
  it('getComponents', () => {
    const components = editor.getComponents();
    expect(components[0]).equal(page);
  });
  it('getCurrentPage', () => {
    expect(editor.getCurrentPage()).equal(page);
  });
  it('destroy', () => {
    editor.destroy();
  });
});
